package com.dd.cloud.user.entity.plat;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.gitee.sunchenbin.mybatis.actable.annotation.Column;
import com.gitee.sunchenbin.mybatis.actable.annotation.Table;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 第三方登录信息表
 * </p>
 *
 * @author czg
 * @since 2022-05-06
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@Table(comment = "第三方用户信息表")
public class PlatformWechatInfo implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 第三方登录信息表
     */
    @TableId(value = "id", type = IdType.AUTO)
    @Column(isKey = true, isAutoIncrement = true)
    private Integer id;

    /**
     * appid
     */
    @Column(length = 100, comment = "appid")
    private String appid;

    /**
     * 昵称
     */
    @Column(length = 50, comment = "昵称")
    private String nickname;

    /**
     * 头像地址
     */
    @Column(length = 500, comment = "头像地址")
    private String headimgurl;

    /**
     * 性别
     */
    @Column(length = 5, comment = "性别")
    private String sex;

    /**
     * 微信公众号openID
     */
    @Column(length = 100, comment = "微信公众号openID")
    private String openid;

    /**
     * 微信小程序openID
     */
    @Column(length = 100, comment = "微信小程序openID")
    private String appletOpenid;

    /**
     * 市
     */
    @Column(length = 20, comment = "市")
    private String city;

    /**
     * 省
     */
    @Column(length = 20, comment = "省")
    private String province;

    /**
     * 国家
     */
    @Column(length = 20, comment = "国家")
    private String country;

    /**
     * 微信unionid
     */
    @Column(length = 100, comment = "微信unionid")
    private String unionid;

    /**
     * 语言
     */
    @Column(length = 20, comment = "语言")
    private String language;

    /**
     * 请求token
     */
    @Column(length = 500, comment = "请求token")
    private String accessToken;

    /**
     * 会话token
     */
    @Column(length = 500, comment = "会话token")
    private String refreshToken;

    /**
     *
     */
    @Column(comment = "数据待用")
    private Integer type;

    /**
     * 创建时间
     */
    @Column(comment = "创建时间")
    private LocalDateTime createDate;

    /**
     * access_token的失效时间
     */
    @Column(comment = "access_token的失效时间")
    private LocalDateTime invalidDate;

    /**
     * 是否绑定过账号 1是 0否
     */
    @TableField(exist = false)
    private Integer bind = 0;
}
